package cn.dao;

import cn.model.File;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by wsx on 2017/1/16.
 */
@Repository
public class DownloadDao extends SpringDao{
    public List<File> findAll() {
        String sql = "select * from file";
        List<File> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(File.class));
        if((null != list)&&list.size() > 0)
            return list;
        else
            return null;
    }
    public List<String> getfsname(String fnewname){
        String sql = "select fsname from file where fnewname =?";
        List<String> list = jdbcTemplate.queryForList(sql,new Object[]{fnewname}, java.lang.String.class);
        return list;
    }
}
